package me.zhengjie.pojo.sqlServer;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @website https://eladmin.vip
 * @description /
 * @author ZhangYY
 * @date 2024-06-26
 **/
@Entity
@Data
@Table(name="pp_storage")
public class PPStorage implements Serializable {

    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`logical_address_type`")
    @ExcelProperty("逻辑地址类型")
    @ApiModelProperty(value = "逻辑地址类型")
    private Integer logicalAddressType;

    @Column(name = "`warehouse_code`")
    @ExcelProperty("仓库编码")
    @ApiModelProperty(value = "仓库编码(PP，PTL)")
    private String warehouseCode;

    @Column(name = "`pallet_code`")
    @ApiModelProperty(value = "载盘编码")
    @ExcelProperty("载盘编码")
    private String palletCode;

    @Column(name = "`zone_code`")
//    @ExcelProperty("库区编码")
    @ExcelProperty("库区编号")
    @ApiModelProperty(value = "库区编号")
    private String zoneCode;

    @Column(name = "`storage_code`")
    @ExcelProperty("储位编码")
    @ApiModelProperty(value = "储位编码")
    private String storageCode;

    @Column(name = "`aisle`")
    @ExcelProperty("巷道号")
    @ApiModelProperty(value = "巷道号")
    private Integer aisle;

    @Column(name = "`layer`")
    @ExcelProperty("层号")
    @ApiModelProperty(value = "层号")
    private Integer layer;

    @Column(name = "`row`")
    @ExcelProperty("排号")
    @ApiModelProperty(value = "排号")
    private Integer row;

    @Column(name = "`column`")
    @ApiModelProperty(value = "列号")
    @ExcelProperty("列号")
    private Integer column;

    @Column(name = "`location_inventory_status`")
    @ApiModelProperty(value = "是否有货（0-无货1-有货）")
//    @ExcelProperty("货位状态(0.无货 1.有货)")
    @ExcelProperty("是否有货")
    private Integer locationInventoryStatus;

    @Column(name = "`status`")
    @ApiModelProperty(value = "是否启用（0-禁用 1-启用）")
//    @ExcelProperty("是否禁用(0.禁用 1.启用)")
    @ExcelProperty("是否启用")

    private Integer status;

    public void copy(PPStorage source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
